From: Florian Müllner Date: Tue, 14 Feb 2017 17:24:50 +0000 (+0100) Subject: Don't mix GJS and GObject signal systems X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~547 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e08f2a4a041;p=gnome-shell.git Don't mix GJS and GObject signal systems GJS implements a basic signal system that allows monkey-patching JS objects with signal methods resembling the GObject ones. However it's clearly not a good idea to replace the actual GObject methods, so use the proper GObject facilities when inheriting from GObject. https://bugzilla.gnome.org/show_bug.cgi?id=778660 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 5b48d5e6e..7ebd968d8 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -899,6 +899,8 @@ const ControlsBoxLayout = Lang.Class({ const ViewStackLayout = new Lang.Class({ Name: 'ViewStackLayout', Extends: Clutter.BinLayout, + Signals: { 'allocated-size-changed': { param_types: [GObject.TYPE_INT, + GObject.TYPE_INT] } }, vfunc_allocate: function (actor, box, flags) { let availWidth = box.x2 - box.x1; @@ -909,7 +911,6 @@ const ViewStackLayout = new Lang.Class({ this.parent(actor, box, flags); } }); -Signals.addSignalMethods(ViewStackLayout.prototype); const AppDisplay = new Lang.Class({ Name: 'AppDisplay', diff --git a/js/ui/edgeDragAction.js b/js/ui/edgeDragAction.js index 5fc4e7257..115b89cdc 100644 --- a/js/ui/edgeDragAction.js +++ b/js/ui/edgeDragAction.js @@ -14,6 +14,7 @@ const DRAG_DISTANCE = 80; const EdgeDragAction = new Lang.Class({ Name: 'EdgeDragAction', Extends: Clutter.GestureAction, + Signals: { 'activated': {} }, _init : function(side, allowedModes) { this.parent(); @@ -81,4 +82,3 @@ const EdgeDragAction = new Lang.Class({ this.emit('activated'); } }); -Signals.addSignalMethods(EdgeDragAction.prototype); diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 324927f68..79b2092a0 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -554,6 +554,7 @@ Signals.addSignalMethods(TouchpadWorkspaceSwitchAction.prototype); const WorkspaceSwitchAction = new Lang.Class({ Name: 'WorkspaceSwitchAction', Extends: Clutter.SwipeAction, + Signals: { 'activated': { param_types: [Meta.MotionDirection.$gtype] } }, _init : function() { const MOTION_THRESHOLD = 50; @@ -591,11 +592,11 @@ const WorkspaceSwitchAction = new Lang.Class({ this.emit('activated', dir); } }); -Signals.addSignalMethods(WorkspaceSwitchAction.prototype); const AppSwitchAction = new Lang.Class({ Name: 'AppSwitchAction', Extends: Clutter.GestureAction, + Signals: { 'activated': {} }, _init : function() { this.parent(); @@ -657,7 +658,6 @@ const AppSwitchAction = new Lang.Class({ return true; } }); -Signals.addSignalMethods(AppSwitchAction.prototype); const ResizePopup = new Lang.Class({ Name: 'ResizePopup',